import type { DataTableColumn } from 'naive-ui';
import { RuleTypeConst } from '@/const';

export const associationColumns = () => 
{
  return [
    {
      title: '规则名称',
      key: 'ruleName',
      width: '80px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },

    },
    {
      title: '规则类型',
      key: 'ruleType',
      width: '100px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },
      render: (row: any) => {
        return (
          RuleTypeConst.find((val: { value: any }) => val.value === row.ruleType)?.label ??
          row.ruleType
        );
      },
    },
    {
      title: '主题表',
      key: 'topicTable',
      width: '120px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },
    },
    {
      title: '检查字段',
      key: 'checkField',
      width: '100px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },

    },
    {
      title: '关联ETL包',
      key: 'etlPackage',
      width: '120px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },

    },
    {
      title: '创始人',
      key: 'creator',
      width: '80px',
      align: 'center',

    },
    {
      title: '创建时间',
      key: 'createTime',
      width: '120px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },

    },
    {
      title: '描述',
      key: 'description',
      width: '100px',
      align: 'center',
      ellipsis: {
        tooltip: true,
      },

    },
    
  ] as DataTableColumn<RuleManegement>[];
};
